#ifndef _PANEL_LOGIN_LOG_H_
#define _PANEL_LOGIN_LOG_H_

#include "inc/_wxWidgets.h"

class wxDataViewCtrl;
class LoginLogModel;
class wxDataViewColumn;
class wxThreadEvent;
class wxBusyInfo;
class wxStaticText;
class wxDateTime;
class wxDatePickerCtrl;
class wxCommandEvent;
class wxTextCtrl;

class LoginLogPanel : public wxPanel
{
private:
    wxDataViewCtrl* _ctrl;
    wxObjectDataPtr<LoginLogModel> _model;
    wxBusyInfo* _busyinfo;
    wxStaticText* _count_text;
    wxDateTime _start_time;
    wxDateTime _end_time;
    wxDatePickerCtrl* _start_time_ctrl;
    wxDatePickerCtrl* _end_time_ctrl;
    wxTextCtrl* _name_filter;
public:
    LoginLogPanel(wxWindow *parent,
                    wxWindowID winid, long list_style,
                    const wxPoint& pos = wxDefaultPosition,
                    const wxSize& size = wxDefaultSize,
                    long style = wxTAB_TRAVERSAL | wxNO_BORDER,
                    const wxString& name = wxPanelNameStr);

//    bool InsertData(const wxString& col0, const wxString& col1, unsigned int col2);
//    void Sort(unsigned int col, bool ascending);
//    int GetColPos(wxDataViewColumn* col);

private:
    bool InitDataViewCtrl(long style = 0);
    bool LoadData();

private:
    void OnLoadingEvent(wxThreadEvent& event);
    void OnFilte(wxCommandEvent& event);

    DECLARE_EVENT_TABLE()
};

#endif // _PANEL_LOGIN_LOG_H_
